//统一管理后台api
//引入封装好的axios
import request from '@/utils/request.js';

//仪表盘、设备概览 接口
export const $deviceCount = () => {
    return request.get('/device/count');
}

// echarts 图表数据  
export const $sensorCount = () => {
    return request.get('/sensor/count');
}

//获取农业基地数据
export const $sensorList = () => {
    return request.get('/device/sensorList')
}


//网关列表数据接口
export const $gatewayList = (params) => {
    console.log(params);
    return request.get('/gateway/list', { params });
}

//设备节点群组
export const $groupList = (params) => {
    return request.get('/group/list', { params });
}
//添加
export const $groupAdd = (data) => {
    return request.post('/group/add', data);
}
//修改
export const $groupEdit = (data) => {
    return request.post('/group/edit', data);
}
//删除
export const $groupDel = (data) => {
    return request.post('/group/del', data);
}

//设备设备列表群组
export const $sensor_List = (params) => {
    return request.get('/sensor/list', { params });
}

/* 充值记录 */
export const $rechargeList = (params) => {
    console.log(params);
    return request.get('/fee/rechargeList', { params });
}

//使用记录
export const $usageList = (params) => {
    console.log(params);
    return request.get('/fee/usageList', { params });
}

//登录
export const $login = (data) => {
    return request.post('/account/login', data)
}

//测量类型列表
export const $meaList = (data) => {
    return request.get('/measurement/list', data)
}

//添加测量类型
export const $meaAdd = (data) => {
    return request.post('/measurement/add', data)
}

//修改测量类型
export const $meaEdit = (data) => {
    return request.post('/measurement/edit', data)
}

//删除测量类型
export const $meaDel = (data) => {
    return request.post('/measurement/del', data)
}

//安全密钥列表
export const $secList = () => {
    return request.get('/security/list')
}

//修改密钥
export const $secEdit = (data) => {
    return request.post('/security/edit', data)
}

//删除密钥
export const $secDel = (data) => {
    return request.post('/security/del', data)
}
//添加密钥
export const $secAdd = (data) => {
    return request.post('/security/add', data);
}


//账号列表
export const $accountList = (data) => {
    return request.get('/account/list', data);
}

//修改密钥
export const $accountEdit = (data) => {
    return request.post('/account/edit', data)
}

//删除密钥
export const $accountDel = (data) => {
    return request.post('/account/del', data)
}
//添加密钥
export const $accountAdd = (data) => {
    return request.post('/account/add', data);
}